<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>MKTB15</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<style type="text/css">
        .list_title2 {
	FONT-WEIGHT: bold;
	BACKGROUND-REPEAT: repeat-x;
	HEIGHT: 27px;
	TEXT-ALIGN: center;
	color: #304D53;
	valign:middle;
	bordercolor:#EFEBDE;
	bgcolor:#F7F5F4;
	BORDER-RIGHT: #CACFD2 1px solid; BORDER-TOP: #CACFD2 1px solid; BORDER-LEFT: #CACFD2 1px solid; BORDER-BOTTOM: #CACFD2 1px solid;
}
        </style>
<SCRIPT language=javascript src="../js/IDEA_body.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript src="../js/ajax.js" type=text/javascript></SCRIPT>
<script src="../js/main.js" language="javascript" type="text/javascript"></script>
<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css" />
<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="../js/languages/jquery.validationEngine-zh_CN.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script src="../My97DatePicker/WdatePicker.js" language="JavaScript" type="text/JavaScript"></SCRIPT>

	
<script type="text/javascript">
     jQuery(document).ready(function() {
		jQuery("#myform").validationEngine({
		    promptPosition: "topLeft",
			autoHidePrompt : true,
			autoPositionUpdate:true
		});
	});
	var tabLeftOn = "../images/pic_title_1.jpg";
	var tabRightOn = "../images/pic_title_2.jpg";
	var tabLeftOff = "../images/pic_title_4.jpg";
	var tabRightOff = "../images/pic_title_4.jpg";
	
    function selectMonth() {  
        WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });  
    }  
    
    function checkTotalEmployee()
    {
                var n_doctor = parseInt(document.getElementById("doctor").value);
    		    var n_master = parseInt(document.getElementById("master").value);
    		    var n_bachelor = parseInt(document.getElementById("bachelor").value);
    		    var n_college = parseInt(document.getElementById("college").value);
    		    var n_totalEmployee = parseInt(document.getElementById("totalEmployee").value);
    		    if((n_doctor+n_master+n_bachelor+n_college)>n_totalEmployee)
    		    {
    		    	return "博士+硕士+本科+大专的总人数应该小于等于总人数";
    		    }
    }
    
    function checkReport()
    {
    		var url = "../report/queryReportExist.html?compId="+${compId }
    		  +"&yearmonth="+document.getElementById("yearmonth").value;
    		  
    		sendRequest1(url);
    		if(document.getElementById("isExist").value != 1)
    		{
    		}
    		else
    		{
    			return "该月报表已提交";
    		}
    }
  //发送请求函数
	function sendRequest1(url) {
		createXMLHttpRequest();
		XMLHttpReq.open("GET", url, false);
		XMLHttpReq.onreadystatechange = processResponse1;//指定响应函数
		XMLHttpReq.send(null);  // 发送请求
	}
	// 处理返回信息函数
     function processResponse1() {
	    if (XMLHttpReq.readyState == 4) 
	    {

	        var isExist = XMLHttpReq.responseText;
	        if(isExist!="1")
	        {
	        	document.getElementById("isExist").value=isExist;
	        }
	        else
	        {
	        	document.getElementById("errMsg").innerHTML="";
	        	document.getElementById("isExist").value=isExist;
	        }
        }
    }
</script>
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
</HEAD>
<BODY>
<form name="myform" id="myform" method="POST" action="../report/addMonthReport.html">
<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
	<TBODY>
		<TR>
			<TD height="100%" bgcolor="#FFFFFF" class=right_bg>
			<table width="100%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="20">&nbsp;</td>
					<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>&gt;
					<a href="#">报表管理</a> &gt; 填写月报表</td>
				</tr>
			</table>
			<table width="100%" height="10" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				background="../images/bg_body_title.jpg" class="list_border1">
				<tr>
					<td width="10">&nbsp;</td>
					<td>
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td><img src="../images/pic_title_1.jpg" name="imgL1"
											width="8" height="24" id="imgL1"></td>
							<td valign="bottom" class="text_12_border">填写月报表</td>
							<td><img src="../images/pic_title_2.jpg" name="imgR1"
											width="8" height="24" id="imgR1"></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				class="list_border2">
				<tr>
					<td align="left" valign="top">
					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<table width="100%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="7%" align="left">
							&nbsp;&nbsp;年月： </td>
                            <td width="83%" align="left">
                                  <input id="yearmonth" name="yearmonth" type="text"
												class="validate[funcCall[checkReport]] Wdate input2" height="20" onclick="selectMonth();"
												value="${yearmonth }" readonly>
                                  <span id="errMsg" class="text_darkred"></span>
                                  <input type="hidden" id="isExist" value="">
                            </td>
                            <td width="10%" align="center">
							<input name="Submit" type="button" class="button_normal"
								value="填写往年汇总" onclick="window.location.href='<%=request.getContextPath()%>/report/newLastReport.html'"></td>
						</tr>
					</table>
					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<TABLE class=list_border cellSpacing=0 cellPadding=0 width="98%"
						border=1>
						<TBODY>
						<TR >
								<TD class=list_title2 rowspan="2" width="5%" >营业收入<br>(万元)</TD>
								<TD class=list_title2 colspan="5"colspan="24" width="25%" >申请知识产权数</TD>
								<TD class=list_title2 rowspan="2" width="5%" >软件产品(件)</TD>
								<TD class=list_title2 colspan="5" width="20%" >人员情况(人)</TD>
							</TR>
							<TR>
								<td class=list_title2 >发明<br>专利
					</td>
					<td class=list_title2 >实用/新型<br>专利(件)
					</td>
					<td class=list_title2 >外观<br>专利(件)
					</td>
					<td class=list_title2 >集成电路<br>布图(个)
					</td>
					<td class=list_title2 >软件著作权<br>(件)
					</td>


					<td class=list_title2 >博士</td>
					<td class=list_title2 >硕士</td>
					<td class=list_title2 >本科</td>
					<td class=list_title2 >大专</td>
					<td class=list_title2 >总数</td>

							</TR>
							<TR>
								<TD align="center"><input name="revenue" id="revenue" type="text" class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="ipInvent" id="ipInvent" type="text" class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="ipNewType" id="ipNewType" type="text" class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="ipLook" id="ipLook" type="text"  class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="icDrawing" id="icDrawing" type="text"  class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="softwareBook" id="softwareBook" type="text"  class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="softwareProd" id="softwareProd" type="text"  class="validate[required,custom[0or9]] input2"  size="10"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="doctor" id="doctor" type="text"  class="validate[required,custom[0or9]] input2"  size="7"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="master" id="master" type="text"  class="validate[required,custom[0or9]] input2"  size="7"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="bachelor" id="bachelor" type="text"  class="validate[required,custom[0or9]] input2"  size="7"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="college" id="college" type="text"  class="validate[required,custom[0or9]] input2"  size="7"><font color="red"><span>*</span></font></TD>
								<TD align="center"><input name="totalEmployee" id="totalEmployee" type="text" class="validate[required,custom[0or9],funcCall[checkTotalEmployee]] input2"  size="7"><font color="red"><span>*</span></font></TD>
							</TR>
							<TR>
							    <TD class=list_title2 align="center">备注</TD>
								<TD colspan="11">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="remark" type="text"  size="146"></TD>
							</TR>
						</TBODY>
					</TABLE>
					<table width="98%" height="42" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="40%" align="center"><input name="Submit2"
								type="submit" class="button_normal" value="完  成">
							&nbsp;&nbsp; <input name="Submit3" type="button"
								class="button_normal" value="返  回"  onclick="window.location.href='../report/queryMonthListComp.html'"></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			</TD>
		</TR>
	</TBODY>
</TABLE>
</FORM>
</BODY>
</HTML>
